package com.itheima.cn;

import java.io.IOException;
import java.net.*;

public class ClientDemo2 {
    public static void main(String[] args) throws IOException {
        DatagramSocket datagramSocket = new DatagramSocket();
        String str ="你好，你现在在干吗？";
        byte[] bytes = str.getBytes();
        InetAddress name = InetAddress.getByName("127.0.0.1");
        int poor = 11000;
        DatagramPacket datagramPacket = new DatagramPacket(bytes, bytes.length, name, poor);

        datagramSocket.send(datagramPacket);
        datagramSocket.close();
    }
}
